﻿using System;
using System.Collections.Generic;

namespace Microsoft.WowAddonStudio.TocEditor
{
	public enum TagType
	{
		BASIC = 0,
		EXTENDED = 1
	} ;

	/// <summary>
	/// Encapsulates necessary information when a metadata entry is changed.
	/// </summary>
	public sealed class MetadataManagerEventArgs : EventArgs
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="MetadataManagerEventArgs"/> class.
		/// </summary>
		/// <param name="sender">The sender.</param>
		/// <param name="entries">The entries.</param>
		/// <param name="affectedEntry">The affected entry.</param>
		/// <param name="tagType">Type of the tag.</param>
		public MetadataManagerEventArgs(IMetadataManager sender,
		                                IEnumerable<KeyValuePair<string, string>> entries, string affectedEntry,
		                                TagType tagType)
		{
			if (sender == null)
				throw new ArgumentNullException("sender");

			if (entries == null)
				throw new ArgumentNullException("entries");

			if (string.IsNullOrEmpty(affectedEntry))
				throw new ArgumentNullException("affectedEntry");

			Sender = sender;
			Entries = entries;
			AffectedEntry = affectedEntry;
			TagType = tagType;
		}

		/// <summary>
		/// Gets the sender.
		/// </summary>
		/// <value>The sender.</value>
		public IMetadataManager Sender { get; private set; }

		/// <summary>
		/// Gets the entries.
		/// </summary>
		/// <value>The entries.</value>
		public IEnumerable<KeyValuePair<string, string>> Entries { get; private set; }

		/// <summary>
		/// Gets the affected entry.
		/// </summary>
		/// <value>The affected entry.</value>
		public string AffectedEntry { get; private set; }

		/// <summary>
		/// Gets the type of the tag.
		/// </summary>
		/// <value>The type of the tag.</value>
		public TagType TagType { get; private set; }
	}
}